package mumu.android.animate;

import mumu.android.R;
import android.app.Activity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.ImageView;

/**
 * 透明度
 * 
 * @author Administrator
 * 
 */
public class frame extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.animate);
		final ImageView img = (ImageView) findViewById(R.id.img_1);
		img.setImageResource(R.drawable.ic_launcher);
	
		final AnimationDrawable animation = new AnimationDrawable();
		animation.addFrame(getResources().getDrawable( R.drawable.ic_launcher), 200);
		animation.addFrame(getResources().getDrawable( R.drawable.image_fail), 200);
		animation.addFrame(getResources().getDrawable( R.drawable.image_indicator), 200);
		animation.setOneShot(false);
		img.setImageDrawable(animation);
	
		img.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				animation.start();
			}
		});
	}

}
